package com.demo.example.dp;

public class DifferentPath {
    public static int total=0;

    public static void main(String[] args) {
        long start=System.currentTimeMillis();
        System.out.println(uniquePaths(23, 12));
        long end=System.currentTimeMillis();
        System.out.println(end-start);
    }

    //机器人每次向右或者向下走一步
    public static void process(int x,int y,int m,int n){
        if(x<=0 || x>m || y<=0 || y>n){
            return;
        }
        if(x==m && y==n){
            total++;
        }
        process(x+1,y,m,n);
        process(x,y+1,m,n);
    }
    public static int uniquePaths(int m,int n){
        total=0;
        process(1,1,m,n);
        return total;
    }
}
